/**
 * 页面头部样式
 */

.header {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  height: var(--header-height);
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 99;
  transition: left 0.3s ease;
}

/* 页面标题 */
.header .page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--heading-color);
}

.header .page-title i,
.header .page-title svg {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

/* 右侧工具栏 */
.header .header-tools {
  display: flex;
  align-items: center;
}

/* 搜索框 */
.header .header-tools .search-form {
  position: relative;
  margin-right: 1.5rem;
}

.header .header-tools .search-form input {
  background-color: var(--light-color);
  border: none;
  border-radius: 50px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: 0.875rem;
  width: 240px;
  transition: all 0.3s;
}

.header .header-tools .search-form input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.25);
  width: 280px;
}

.header .header-tools .search-form .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* 用户菜单 */
.header .header-tools .user-menu {
  position: relative;
}

.header .header-tools .user-menu .user-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.header .header-tools .user-menu .user-toggle .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--primary-color);
  margin-right: 0.75rem;
}

.header .header-tools .user-menu .user-toggle .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header .header-tools .user-menu .user-toggle .user-info {
  display: flex;
  flex-direction: column;
}

.header .header-tools .user-menu .user-toggle .user-info .user-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.header .header-tools .user-menu .user-toggle .user-info .user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header .header-tools .user-menu .user-toggle .dropdown-icon {
  margin-left: 0.5rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.header .header-tools .user-menu .user-toggle.active .dropdown-icon {
  transform: rotate(180deg);
}

.header .header-tools .user-menu .dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  min-width: 200px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
}

.header .header-tools .user-menu .dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header .header-tools .user-menu .dropdown-menu ul {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.header .header-tools .user-menu .dropdown-menu ul li a {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  color: var(--text-color);
}

.header .header-tools .user-menu .dropdown-menu ul li a i,
.header .header-tools .user-menu .dropdown-menu ul li a svg {
  margin-right: 0.75rem;
  width: 16px;
  color: var(--text-muted);
}

.header .header-tools .user-menu .dropdown-menu ul li a:hover {
  background-color: var(--light-color);
}

.header .header-tools .user-menu .dropdown-menu ul li.divider {
  height: 1px;
  margin: 0.5rem 0;
  background-color: var(--border-color);
}

/* 通知菜单 */
.header .header-tools .notifications {
  margin-right: 1.5rem;
  position: relative;
}

.header .header-tools .notifications .notification-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.header .header-tools .notifications .notification-toggle:hover {
  background-color: var(--light-color-dark);
}

.header .header-tools .notifications .notification-toggle .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--danger-color);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 侧边栏切换按钮 */
.header .sidebar-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 1rem;
  transition: background-color 0.2s;
}

.header .sidebar-toggle:hover {
  background-color: var(--light-color-dark);
}

/* 侧边栏折叠状态下的头部 */
.sidebar-collapsed .header {
  left: var(--sidebar-collapsed-width);
}

/* 响应式调整 */
@media (max-width: 991px) {
  .header {
    left: var(--sidebar-collapsed-width);
  }
  
  .header .search-form input {
    width: 180px;
  }
  
  .header .search-form input:focus {
    width: 220px;
  }
}

@media (max-width: 767px) {
  .header {
    left: 0;
  }
  
  .header .search-form {
    display: none;
  }
  
  .header .user-menu .user-info {
    display: none;
  }
  
  .sidebar-toggle {
    display: block !important;
  }
} 